package com.ruibang.glass.material.controller.ybyq;

import com.ruibang.glass.material.domain.req.ycl.ManageOutBoundReq;
import com.ruibang.glass.material.domain.req.ycl.ManageOutInReq;
import com.ruibang.glass.material.entity.yqyb.MaterialYBYQManagementInventory;
import com.ruibang.glass.material.entity.yqyb.MaterialYBYQOutboundManagement;
import com.ruibang.glass.material.service.yqyb.GMaterialYBYQOutboundManagementService;
import com.teaming.cloud.framework2.common.model.ResultBody;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 仪表仪器出库管理 前端控制器
 * </p>
 *
 * @author mameng
 * @since 2024-02-05
 */
@RestController

@RequestMapping("/api/material/ybyq/out/bound/manage")
@Api(value="仪表仪器出库管理",tags={"仪表仪器出库"})
public class MaterialYBYQOutBoundController {

    @Autowired
    private GMaterialYBYQOutboundManagementService materialOutboundManagementService;


    @PostMapping("/list")
    @ApiOperation(value = "仪表仪器出库管理列表", response = ResultBody.class)
    public ResultBody getPageList(@RequestBody ManageOutBoundReq materialManagementReq) {
        return ResultBody.success(materialOutboundManagementService.getPage(materialManagementReq));
    }

    @PostMapping("/update")
    @ApiOperation(value = "更新", response = ResultBody.class)
    public ResultBody updateById(@RequestBody MaterialYBYQOutboundManagement materialManagement) {
        return ResultBody.success(materialOutboundManagementService.updateById(materialManagement));
    }

    @GetMapping("/getOne/{id}")
    @ApiOperation(value = "获取对象", response = ResultBody.class)
    public ResultBody getOneById(@PathVariable("id") String id) {
        return ResultBody.success(materialOutboundManagementService.getById(id));
    }

    @PostMapping("/getBondList")
    @ApiOperation(value = "仪表仪器出入库流水列表", response = ResultBody.class)
    public ResultBody getBondList(@RequestBody ManageOutInReq manageOutInReq) {
        return ResultBody.success(materialOutboundManagementService.getPage(manageOutInReq));
    }


    @PostMapping("/add")
    @ApiOperation(value = "仪表仪器入库管理新增", response = ResultBody.class)
    public ResultBody add(@RequestBody MaterialYBYQOutboundManagement materialManagement) {
        materialOutboundManagementService.saveMaterialManagementInventory(materialManagement);
        return ResultBody.success();
    }




}
